/*
 * Copyright 2007 Jaisy Sprl.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package be.jaisy.ui.gwt.widget.client.viewer;

/**
 * A label provider mediates between the viewer's model and the viewer itself.
 * 
 * @author Stany Blanvalet <stany.blanvalet@jaisy.be>
 */
public interface ILabelProvider
{

	/**
	 * Returns the text String or Widget for the label of the given element.
	 * 
	 * @param element
	 *           the element for which to provide the label
	 * @return the text string or Widget used to label the element, or <code>null</code> if there is no label for the given object
	 */
	public Object getCell(Object element);

	/**
	 * Returns the text String for the label of the given element.
	 * 
	 * @param element
	 *           the element for which to provide the label
	 * @return the text string used to label the element, or <code>null</code> if there is no label for the given object or the
	 *         label in not of type String
	 */
	public String getCellAsText(Object element, int columnIndex);

	/**
	 * Returns the Style String for the style of the given element.
	 * 
	 * @param element
	 *           the element for which to provide the style
	 * @return the Style string used to style the element, or <code>null</code> if there is no style for the given object
	 */
	public String getCellStyle(Object element);
}